#include <gtest/gtest.h>
#include <vector>
#include "game_init.pb.h"

TEST(tc_protobuf, game_init_debug)
{
    std::vector<char> proto_raw_data = {
        0x12, 0x04, 0x08, 0x07, 0x10, 0x1d, 0x12, 0x04, 0x08, 0x09, 0x10, 0x12, 0x12, 0x04, 0x08, 0x09, 0x10, 0x01, 
        0x12, 0x02, 0x08, 0x0e, 0x12, 0x04, 0x08, 0x05, 0x10, 0x19, 0x12, 0x04, 0x08, 0x0b, 0x10, 0x12, 0x12, 0x02, 
        0x10, 0x19, 0x12, 0x04, 0x08, 0x0b, 0x10, 0x16, 0x12, 0x02, 0x08, 0x06, 0x12, 0x04, 0x08, 0x04, 0x10, 0x02, 
        0x12, 0x02, 0x08, 0x05, 0x12, 0x04, 0x08, 0x02, 0x10, 0x1d, 0x12, 0x04, 0x08, 0x09, 0x10, 0x1d, 0x12, 0x04, 
        0x08, 0x01, 0x10, 0x1a, 0x12, 0x02, 0x10, 0x0b, 0x12, 0x04, 0x08, 0x0f, 0x10, 0x02, 0x12, 0x04, 0x08, 0x07, 
        0x10, 0x08, 0x12, 0x04, 0x08, 0x0c, 0x10, 0x04, 0x12, 0x04, 0x08, 0x0c, 0x10, 0x1b, 0x12, 0x04, 0x08, 0x0f, 
        0x10, 0x0e, 0x12, 0x04, 0x08, 0x06, 0x10, 0x1c, 0x12, 0x04, 0x08, 0x04, 0x10, 0x11, 0x12, 0x04, 0x08, 0x0d, 
        0x10, 0x03, 0x12, 0x04, 0x08, 0x04, 0x10, 0x19, 0x12, 0x04, 0x08, 0x0a, 0x10, 0x04, 0x12, 0x04, 0x08, 0x0e, 
        0x10, 0x19, 0x12, 0x02, 0x08, 0x03, 0x12, 0x04, 0x08, 0x06, 0x10, 0x1d, 0x12, 0x04, 0x08, 0x0e, 0x10, 0x0a, 
        0x12, 0x04, 0x08, 0x02, 0x10, 0x17, 0x12, 0x04, 0x08, 0x0c, 0x10, 0x18, 0x12, 0x02, 0x10, 0x03, 0x12, 0x04, 
        0x08, 0x04, 0x10, 0x05, 0x12, 0x04, 0x08, 0x05, 0x10, 0x1b, 0x12, 0x04, 0x08, 0x0b, 0x10, 0x06, 0x12, 0x04, 
        0x08, 0x05, 0x10, 0x12, 0x12, 0x04, 0x08, 0x04, 0x10, 0x0c, 0x12, 0x04, 0x08, 0x02, 0x10, 0x1a, 0x12, 0x04, 
        0x08, 0x06, 0x10, 0x11, 0x12, 0x04, 0x08, 0x0a, 0x10, 0x0c, 0x12, 0x04, 0x08, 0x03, 0x10, 0x11, 0x12, 0x04, 
        0x08, 0x02, 0x10, 0x13, 0x12, 0x04, 0x08, 0x0d, 0x10, 0x13, 0x12, 0x04, 0x08, 0x0d, 0x10, 0x1c, 0x12, 0x04, 
        0x08, 0x01, 0x10, 0x0f, 0x12, 0x02, 0x08, 0x08, 0x12, 0x04, 0x08, 0x01, 0x10, 0x14, 0x12, 0x04, 0x08, 0x0b, 
        0x10, 0x17, 0x12, 0x04, 0x08, 0x03, 0x10, 0x0b, 0x12, 0x04, 0x08, 0x06, 0x10, 0x09, 0x12, 0x04, 0x08, 0x04, 
        0x10, 0x14, 0x12, 0x04, 0x08, 0x0f, 0x10, 0x15, 0x12, 0x04, 0x08, 0x04, 0x10, 0x03, 0x12, 0x04, 0x08, 0x0e, 
        0x10, 0x02, 0x12, 0x04, 0x08, 0x01, 0x10, 0x1d, 0x12, 0x04, 0x08, 0x07, 0x10, 0x0c, 0x12, 0x04, 0x08, 0x07, 
        0x10, 0x1c, 0x12, 0x04, 0x08, 0x02, 0x10, 0x04, 0x12, 0x02, 0x10, 0x17, 0x12, 0x04, 0x08, 0x02, 0x10, 0x07, 
        0x12, 0x04, 0x08, 0x0f, 0x10, 0x19, 0x12, 0x04, 0x08, 0x03, 0x10, 0x15, 0x12, 0x02, 0x10, 0x0f, 0x12, 0x04, 
        0x08, 0x06, 0x10, 0x03, 0x12, 0x04, 0x08, 0x02, 0x10, 0x1c, 0x12, 0x04, 0x08, 0x0f, 0x10, 0x14, 0x12, 0x04, 
        0x08, 0x04, 0x10, 0x0d, 0x12, 0x04, 0x08, 0x05, 0x10, 0x17, 0x12, 0x04, 0x08, 0x09, 0x10, 0x02, 0x12, 0x04, 
        0x08, 0x01, 0x10, 0x13, 0x12, 0x04, 0x08, 0x07, 0x10, 0x05, 0x12, 0x04, 0x08, 0x0b, 0x10, 0x0e, 0x12, 0x04, 
        0x08, 0x04, 0x10, 0x0f, 0x12, 0x04, 0x08, 0x05, 0x10, 0x1c, 0x12, 0x04, 0x08, 0x01, 0x10, 0x07, 0x12, 0x04, 
        0x08, 0x0a, 0x10, 0x18, 0x12, 0x04, 0x08, 0x03, 0x10, 0x0a, 0x12, 0x04, 0x08, 0x0c, 0x10, 0x09, 0x12, 0x04, 
        0x08, 0x02, 0x10, 0x10, 0x12, 0x04, 0x08, 0x0b, 0x10, 0x1b, 0x12, 0x04, 0x08, 0x09, 0x10, 0x14, 0x12, 0x04, 
        0x08, 0x05, 0x10, 0x15, 0x12, 0x04, 0x08, 0x0b, 0x10, 0x0f, 0x12, 0x04, 0x08, 0x08, 0x10, 0x0f, 0x12, 0x04, 
        0x08, 0x09, 0x10, 0x1a, 0x12, 0x04, 0x08, 0x07, 0x10, 0x09, 0x12, 0x04, 0x08, 0x03, 0x10, 0x02, 0x12, 0x04, 
        0x08, 0x08, 0x10, 0x07, 0x12, 0x04, 0x08, 0x09, 0x10, 0x07, 0x12, 0x04, 0x08, 0x07, 0x10, 0x19, 0x12, 0x04, 
        0x08, 0x0c, 0x10, 0x06, 0x12, 0x04, 0x08, 0x06, 0x10, 0x17, 0x12, 0x04, 0x08, 0x01, 0x10, 0x0d, 0x12, 0x04, 
        0x08, 0x0e, 0x10, 0x08, 0x12, 0x04, 0x08, 0x03, 0x10, 0x1a, 0x12, 0x04, 0x08, 0x0e, 0x10, 0x15, 0x12, 0x04, 
        0x08, 0x07, 0x10, 0x18, 0x12, 0x02, 0x10, 0x10, 0x12, 0x04, 0x08, 0x01, 0x10, 0x10, 0x1a, 0x04, 0x08, 0x05, 
        0x10, 0x07, 0x1a, 0x04, 0x08, 0x04, 0x10, 0x06, 0x1a, 0x04, 0x08, 0x04, 0x10, 0x07, 0x1a, 0x04, 0x08, 0x03, 
        0x10, 0x06, 0x1a, 0x04, 0x08, 0x03, 0x10, 0x07, 0x1a, 0x04, 0x08, 0x03, 0x10, 0x08, 0x1a, 0x04, 0x08, 0x04, 
        0x10, 0x08, 0x1a, 0x04, 0x08, 0x03, 0x10, 0x09, 0x1a, 0x04, 0x08, 0x04, 0x10, 0x09, 0x1a, 0x04, 0x08, 0x05, 
        0x10, 0x08, 0x1a, 0x04, 0x08, 0x05, 0x10, 0x09, 0x1a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x1a, 0x04, 0x08, 0x06, 
        0x10, 0x06, 0x1a, 0x04, 0x08, 0x06, 0x10, 0x07, 0x1a, 0x04, 0x08, 0x06, 0x10, 0x08
    };

    std::string proto_raw_data_str(proto_raw_data.begin(), proto_raw_data.end());
    GameInitS2CProto gameInitProto;
    try {
        bool parse_result = gameInitProto.ParseFromString(proto_raw_data_str);
    } catch (const std::exception& e) {
        std::cerr << "ParseFromString failed: " << e.what() << std::endl;
        return;
    }

    std::cout << "game init proto debug string: " << gameInitProto.DebugString() << std::endl;
}
